package com.crr.springmq;


import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class Consumer {
    @RabbitListener(queues={"hello"})
    public void handler(Message message){
        System.out.println("消费者消费："+new String(message.getBody()));

    }
}
